package com.gmf.sugar.service;

import java.util.HashMap;
import java.util.Map;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Context {
	public static final String DIGGING_SERVLET_URL="DIGGING_SERVLET_URL";
	public static final String CUBE_LIST="CUBE_LIST";
	public static final String CURRENT_CUBE="CURRENT_CUBE";
	public static final ApplicationContext SPRING_CTX;
	private static final Map<String,String> RUNTIME_CTX = new HashMap<String,String>();
	
	private Context(){};
	
	static {
		SPRING_CTX = new ClassPathXmlApplicationContext(new String[] {"applicationContext.xml"});
	}
	
	public static String getRuntimeValue(String name){
		return RUNTIME_CTX.get(name);
	}
	
	public static void setRuntimeValue(String name, String value){
		RUNTIME_CTX.put(name, value);
	}
	
	
	
	
	
	

}
